Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LINK_COMPONENTS to link LLVMSupport #2573

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bjacob
Copy link

@bjacob bjacob commented Oct 2, 2024

In #2494, LLVMSupport was added as a linked dependency to a few targets such as ChloCAPI, using the add_mlir_public_c_api_library function, passing LLVMSupport along with other dependencies under LINK_LIBS.

Trying to integrate these changes in https://github.com/iree-org/iree , I get these CMake errors:

CMake Error at build/lib/cmake/mlir/AddMLIR.cmake:265 (message):
  ChloCAPI specifies LINK_LIBS LLVMSupport, but LINK_LIBS cannot be used for
  LLVM libraries.  Please use LINK_COMPONENTS instead.
Call Stack (most recent call first):
  build/lib/cmake/mlir/AddMLIR.cmake:375 (_check_llvm_components_usage)
  build/lib/cmake/mlir/AddMLIR.cmake:637 (add_mlir_library)
  third_party/stablehlo/stablehlo/integrations/c/CMakeLists.txt:24 (add_mlir_public_c_api_library)

This PR is simply following the suggesting in that error message, and that seems to work.

Signed-off-by: Benoit Jacob <[email protected]>
@bjacob
Copy link
Author

bjacob commented Oct 2, 2024

@GleasonK @ScottTodd

@bjacob
Copy link
Author

bjacob commented Oct 2, 2024

This is actually failing to link in the CI. I don't have that problem in my dependent project (IREE) where Stablehlo is external. I don't know what the proper solution would look like. For now, I can just cherry-pick this.

bjacob added a commit to iree-org/iree that referenced this pull request Oct 2, 2024
Continuing from @hanhanW 's #18659:

Stablehlo cherry-picks:
1. openxla/stablehlo#2572
2. openxla/stablehlo#2573

Torch-mlir cherry-picks:
1. llvm/torch-mlir#3755

---------

Signed-off-by: hanhanW <[email protected]>
Signed-off-by: Benoit Jacob <[email protected]>
Co-authored-by: hanhanW <[email protected]>
@sdasgup3 sdasgup3 self-requested a review October 2, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants